package easy.爬楼梯;

import java.util.Arrays;

public class Solution {
    public int climbStairs(int n) {
        int p = 0, q = 0, r = 1;
        for (int i = 0; i < n; i++) {
            p = q;
            q = r;
            r = p + q;
        }
        return r;
    }

    public static void main(String[] args) {
        int n = 4;
        int n2 = 3;
        Solution solution = new Solution();
        System.out.println(solution.climbStairs(n));
        System.out.println(solution.climbStairs(n2));
    }
}
